all: main

main: ./cgame.o ./common.o ./cplayer.o ./ctrain.o ./cworld.o ./game_stage.o ./input_pipeline.o ./main.o ./obj_cart.o ./obj_cart_front.o ./obj_cart_truck.o ./obj.o ./obj_grass.o ./obj_obstacle.o ./obj_orail.o ./obj_wagon.o ./obj_wagon_flat.o ./obj_wagon_locomotive.o ./obj_window.o ./render_pipeline.o ./sound_pipeline.o ./timer.o
	g++ `sdl-config --cflags`  `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer -lGL -lGLU $^ -o ../main

cgame.o: cgame.cpp cgame.h cworld.h ctrain.h obj_wagon_locomotive.h obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h obj_wagon_flat.h obj_obstacle.h cplayer.h obj_cart.h obj_cart_front.h obj_cart_truck.h obj_grass.h
	g++ -g -c cgame.cpp -o cgame.o

common.o: common.cpp common.h
	g++ -g -c common.cpp -o common.o

cplayer.o: cplayer.cpp cplayer.h obj_cart.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h obj_cart_front.h obj_cart_truck.h
	g++ -g -c cplayer.cpp -o cplayer.o

ctrain.o: ctrain.cpp ctrain.h obj_wagon_locomotive.h obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h obj_wagon_flat.h obj_obstacle.h
	g++ -g -c ctrain.cpp -o ctrain.o

cworld.o: cworld.cpp cworld.h ctrain.h obj_wagon_locomotive.h obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h obj_wagon_flat.h obj_obstacle.h cplayer.h obj_cart.h obj_cart_front.h obj_cart_truck.h obj_grass.h
	g++ -g -c cworld.cpp -o cworld.o

game_stage.o: game_stage.cpp game_stage.h common.h
	g++ -g -c game_stage.cpp -o game_stage.o

input_pipeline.o: input_pipeline.cpp input_pipeline.h render_pipeline.h common.h obj.h sound_pipeline.h game_stage.h timer.h
	g++ -g -c input_pipeline.cpp -o input_pipeline.o

main.o: main.cpp render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_window.h cgame.h cworld.h ctrain.h obj_wagon_locomotive.h obj_wagon.h obj_orail.h obj_wagon_flat.h obj_obstacle.h cplayer.h obj_cart.h obj_cart_front.h obj_cart_truck.h obj_grass.h
	g++ -g -c main.cpp -o main.o

obj_cart.o: obj_cart.cpp obj_cart.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_cart.cpp -o obj_cart.o

obj_cart_front.o: obj_cart_front.cpp obj_cart_front.h obj_cart.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_cart_front.cpp -o obj_cart_front.o

obj_cart_truck.o: obj_cart_truck.cpp obj_cart_truck.h obj_cart.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_cart_truck.cpp -o obj_cart_truck.o

obj.o: obj.cpp obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj.cpp -o obj.o

obj_grass.o: obj_grass.cpp obj_grass.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_grass.cpp -o obj_grass.o

obj_obstacle.o: obj_obstacle.cpp obj_obstacle.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_obstacle.cpp -o obj_obstacle.o

obj_orail.o: obj_orail.cpp obj_orail.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_orail.cpp -o obj_orail.o

obj_wagon.o: obj_wagon.cpp obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h
	g++ -g -c obj_wagon.cpp -o obj_wagon.o

obj_wagon_flat.o: obj_wagon_flat.cpp obj_wagon_flat.h obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h
	g++ -g -c obj_wagon_flat.cpp -o obj_wagon_flat.o

obj_wagon_locomotive.o: obj_wagon_locomotive.cpp obj_wagon_locomotive.h obj_wagon.h render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h obj_orail.h
	g++ -g -c obj_wagon_locomotive.cpp -o obj_wagon_locomotive.o

obj_window.o: obj_window.cpp obj_window.h obj.h common.h input_pipeline.h render_pipeline.h timer.h sound_pipeline.h game_stage.h
	g++ -g -c obj_window.cpp -o obj_window.o

render_pipeline.o: render_pipeline.cpp render_pipeline.h common.h obj.h input_pipeline.h sound_pipeline.h game_stage.h timer.h
	g++ -g -c render_pipeline.cpp -o render_pipeline.o

sound_pipeline.o: sound_pipeline.cpp sound_pipeline.h common.h
	g++ -g -c sound_pipeline.cpp -o sound_pipeline.o

timer.o: timer.cpp timer.h
	g++ -g -c timer.cpp -o timer.o

clean:
	rm -f ./*.o
